import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import type { Directive } from 'vue'

import App from './App.vue'
import router from './router'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import * as directives from '@/directives/index'

const app = createApp(App)
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

Object.keys(directives).forEach((key) => {
  app.directive(key, (directives as { [key: string]: Directive })[key])
})

app.use(pinia)
app.use(router)
app.mount('#app')
